﻿/* 
 * author: www.cnblogs.com/luminji
 * date  : 2011/12/14
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Luminji.Core.Enterprise.RBAC;

namespace Luminji.Exam.Application
{
    public static class ApplicationSession
    {
        public static string Title { get; set; }

        private static List<Role> _roles;
        //模拟系统总共有两类角色
        //第一类角色Manager，有增加和修改权限
        //第二类角色Common，没有任何权限
        public static List<Role> Roles
        {
            get
            {
                if (_roles == null)
                {
                    _roles = new List<Role>()
                             {
                                 new Role(){Name = "Teacher", Tasks = new List<TaskAttribute>()
                                                                          {
                                                                              new TaskAttribute("PaperIndex"),   
                                                                              new TaskAttribute("SavePaper")
                                                                          }},                     
                                 new Role(){Name = "Common", Tasks = new List<TaskAttribute>()}
                             };
                }
                return _roles;
            }
        }
    }
}
